#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#
using namespace std;

#define N 2
#define NUM 1024

int main()
{

    int pipefd[N] = {0};
    int n = pipe(pipefd);
    if(n < 0) return 1;
    //printf("pipebuf[0]:%d,pipebuf[0]:%d\n",pipebuf[0],pipebuf[1]);
    pid_t id = fork();

    if(id == 0)
    {
        char buf[NUM];
        close(pipefd[0]);
        int num = 0;
        char* str = "chen-sb"; 
        while(1)
        {
            
            buf[0] = 0;
            write(pipefd[1],buf,strlen(buf));
        }
    }
    
    return 0;
}